package org.hxzon.demo.groovy

class ClosuresDemo {

    static main(args) {
        def biggest = { number1, number2 -> number1<number2?number2:number1 }
        // We can invoke the call method of the Closure class
        def result = biggest.call(7, 1)
        println result
        // We can use the closure reference as if it were a method
        result = biggest(3, 5)
        println result
        // And with optional parenthesis
        result = biggest 13, 1
        println result
    }
}
